package com.example.financechain.common;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;

//@Component
//@Aspect
@Slf4j
public class Mylog {

//    @Pointcut("execution(* com.example.blogdemo.controller.ArticleController.articles(..))")
    private void log(){}


    @Around("log()")
    public void method(ProceedingJoinPoint pjp) throws Throwable {
//        log.info();
//        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
//        System.out.println(methodName);

        Signature signature = pjp.getSignature();
        //类名
        String className = pjp.getTarget().getClass().getSimpleName();
        //调用的方法名
        String methodName2 = signature.getName();



        log.info(methodName2+"////////////////////////////////////");
    }
}
